package com.lifeng.patterns.dproxy;

import java.lang.reflect.Proxy;

/**
 * Created by lifeng on 2018/8/15.
 * 代理工厂
 */
public class MyProxyFactory {
    public <T> T getInstance(Class<T> t){
        MethodProxy methodProxy = new MethodProxy();
        return (T) Proxy.newProxyInstance(t.getClassLoader(),new Class[]{t},methodProxy);
    }
}
